package org.jtzc.springaiagent.agent.planning;

import org.jtzc.springaiagent.agent.BaseAgent;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author wu chuang
 * @description 销售
 */
@Service
public class PlannerAgent implements BaseAgent {

    @Autowired
    private ChatClient chatClient;


    @Override
    public AgentResponse execute(AgentRequest request) {
        String system = "你做为计划的指定者,需要把计划制作的合理并且是一步一步的制作.罗列出来1, 2, 3 这样的内容";
        String response = chatClient.prompt().system(system).user(request.prompt()).call().content();
        return new AgentResponse(response, Map.of("PlannerAgent", "gpt-4"));
    }
}
